var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {

  let target=req.cookies.userInfo;
  console.log(target);

  if(target!=null){

    let tag={

        nick:target.nick,
        number:target.user,
        face:target.face,
        login:true,
        sign:false
    };

      res.render('index',{user:tag});

  }else{

      let tag={

          login:false,
          sign:true
      };
      res.render('index',{user:tag});
  }

});

module.exports = router;




